﻿
@{
    ViewBag.Title = "系统登录";
}

@section Head{
    <style>
        .lognTitle {
            width: 600px;
            height: 446px;
            top: 50%;
            left: 50%;
            margin: -223px 0 0 -300px;
            position: absolute;
        }

            .lognTitle h1 {
                font-size: 45px;
                color: #555;
                text-align: center;
                clear: both;
            }
    </style>
    <script type="text/javascript">
        $(function () {
            $("#btnLogin").click(function () {
                var name = $("#txtName").val().Trim();
                var pwd = $("#txtPwd").val().Trim();
                var yzm = $("#txtYzmCode").val().Trim();
                if (name.isNull() || pwd.isNull()) {
                    alert("用户名和密码不能为空");
                    return;
                }
                if (yzm.isNull()) {
                    alert("验证码不能为空");
                    return;
                }
                $.Ajax("Account/CheckLogin", { name: name, pwd: pwd, yzm: yzm }, function (ref) {
                    var info = ref.parse();
                    if (1 == info.state) {
                        window.location = "/Home/Index";
                    }
                    else {
                        alert(info.msg);
                    }
                })
            });
            //验证码图片点击事件
            $("#randImage").mousedown(function () {
                $("#randImage").attr('src', "/Account/YzmImage?r=" + Math.random());
            })

            //注册回车事件
            $("body").keydown(function () {
                if (event.keyCode == 13) {
                    $('#btnLogin').click();
                    return false;
                }
            });
        });
    </script>
<link href="~/Content/css/base.css" rel="stylesheet" type="text/css" />
<link href="~/Content/css/login.css" rel="stylesheet" type="text/css" />
}
<div class="log">
    <div class="lognTitle">
        <h1>@GongZuo.Common.Utils.GetAppSetting("webName")</h1>
    </div>
    <div class="logn">

        <div class="lognr">
            <div class="logDiv">
                <font>用户名: </font>
                <input id="txtName" type="text" />
            </div>
           <div class="logDiv">
               <font>密<i></i>码: </font>
               <input  id="txtPwd" class="pass" type="password"/>
           </div>
            <div class="logDiv">
                <font>验证码: </font>
                <input class="yzm" id="txtYzmCode" />
                <img class="yzmImg" id="randImage" title="点击更换验证码"  src='@Url.Content("~/Account/YzmImage")' style="cursor:pointer"/>
            </div>
            <div class="logDiv" style="text-align:center;margin:10px 0 0 0;">
                <a id="btnLogin" class="btn">登录</a>
            </div>
            <div class="logDiv" style="text-align:center;">

            </div>
            <div>
                 请使用谷歌浏览器
            </div>
        </div>
    </div>
</div>

@section Body{
    <script>
        layui.use(['element', 'layer'], function () {

        });
    </script>
    }
